import axios from "axios";

const ins = axios.create({
    timeout: 10000,
    baseURL: ""
})
// 响应拦截器
ins.interceptors.response.use(res => {
    return res.data
}, err => {
    return Promise.reject(err)
})


export const post = (url, data, config = {}) => ins.post(url, data, config)
/**
 * Get请求
 * @param url 请求地址
 * @param config 请求配置 -- 额外请求
 * @returns Promise<T>
 */
export const get = (url, config = {}) => ins.get(url, config)